package com.supcon.exchangedata.repository.slave6;
import com.supcon.exchangedata.pojo.entity.mysql.operation.gj.SgjjtBusGps;
import com.supcon.exchangedata.pojo.entity.mysql.operation.hj.HjCleanGps;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: exchange-data
 * @description: gps数据
 * @author: cherubr.Sumin
 * @create: 2021-12-15 14:19
 **/
public interface SlaveCarGpsInfoOrigin extends JpaRepository<HjCleanGps,String> {

    @Transactional
    @Query(nativeQuery = true,value = "SELECT * FROM hj_clean_gps where biz_time > ADDDATE(now(),interval -15 minute) and op = 'insert'")
    List<HjCleanGps> findCurrentBusCarStation();


    @Transactional
    @Query(nativeQuery = true,value = "SELECT * FROM hj_clean_gps WHERE tongid=(SELECT MAX(tongid) from hj_clean_gps)")
    HjCleanGps maxTongId();

}
